/*
 * Copyright (c) 2008-2013 Haulmont. All rights reserved.
 * Use is subject to license terms, see http://www.cuba-platform.com/license for details.
 */

package com.haulmont.asu.entity;

import com.haulmont.chile.core.annotations.NamePattern;
import com.haulmont.cuba.core.entity.StandardEntity;

import javax.persistence.*;
import java.util.Date;

/**
 * Author: Sergey42
 * Date: 14.10.13 11:57
 */
@Table(name = "EXT_PERSON")
@Entity(name = "ext$Person")
@DiscriminatorColumn(name = "TYPE", discriminatorType = DiscriminatorType.STRING)
@Inheritance(strategy = InheritanceType.JOINED)
@NamePattern("%s|name")
public class Person extends StandardEntity {

    private static final long serialVersionUID = -8941452797140972081L;

    @Column(name = "NAME", length = 100)
    protected String name;

    @Column(name = "FIRST_NAME", length = 50)
    protected String firstName;

    @Column(name = "LAST_NAME", length = 50)
    protected String lastName;

    @Column(name = "MIDDLE_NAME", length = 50)
    protected String middleName;

    @Column(name = "BIRTH_DATE")
    @Temporal(TemporalType.DATE)
    protected Date birthDate;

    @Column(name = "PHONE", length = 20)
    protected String phone;

    @Column(name = "EMAIL", length = 50)
    protected String email;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public String getMiddleName() {
        return middleName;
    }

    public void setMiddleName(String middleName) {
        this.middleName = middleName;
    }

    public Date getBirthDate() {
        return birthDate;
    }

    public void setBirthDate(Date birthDate) {
        this.birthDate = birthDate;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }
}
